home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 8661 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.3 KB

  1. Path: news.bridge.net!news
  2. From: David Byrden <100101.2547@compuserve.com>
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: RE: No struct in C++!!?
  5. Date: 25 Feb 1996 22:21:57 GMT
  6. Organization: self-employed
  7. Message-ID: <4gqne5$ci3@news.bridge.net>
  8. References: <1996Feb14.151620.5532@queens-belfast.ac.uk> <00001a81+0000a7ee@msn.com>
  9. NNTP-Posting-Host: ppp-mia1-43.bridge.net
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13. X-Mailer: Mozilla 1.1N (Windows; I; 16bit)
  14.  
  15.  
  16. >>  I found in different C++ books examples of C++ programms
  17. >> which contain type declarations and definitions in the main() programm 
  18. >> - for example a struct  - as in C.
  19. >> My question is, whether this is a contradiction to the paradigm of 
  20. >> C++.
  21.  
  22.  
  23.    Firstly, those examples that you saw may have been classes. They 
  24. keyword "struct" in C++ means almost exactly the same as "class".
  25.  
  26.    Secondly, a struct with public data members is certainly not what OOP 
  27. is all about, but that does not make it the spawn of the devil. It may be 
  28. so simple that you would be wasting time by encapsulating its data. Even 
  29. in the standard library, there is a struct called "pair" which is used to 
  30. bind two values together so that a function can return them both.
  31.  
  32.  
  33.                                  David
  34.  
  35.  
  36.